package vn.candyapp.qlct;

import android.content.Context;
import android.content.SharedPreferences;

public class SharePreferencesManager {
	
	private static final String PREF_NAME = "vn.candyapp.qlct.pref";
	
	private SharedPreferences pref;
	
	public static SharePreferencesManager newInstance(Context context) {
		return new SharePreferencesManager(context);
	}
	
	public SharePreferencesManager(Context context) {
		pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
	}
	
	public boolean isFirstLaunch() {
		return pref.getBoolean("firstLaunch", true);
	}
	
	public void setFirstLaunch(boolean value) {
		pref.edit().putBoolean("firstLaunch", value).commit();
	}
	
	public String getLanguage() {
		return pref.getString("language", "vi");
	}
	
	public void setLanguage(String language) {
		pref.edit().putString("language", language).commit();
	}
	
	public String getCurrency() {
		return pref.getString("currency", "VND");
	}
	
	public void setCurrency(String currency) {
		pref.edit().putString("currency", currency).commit();
	}
}
